<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>json跨域</h1>
    <!-- <script>
        const xhr = new XMLHttpRequest();
        xhr.open('get', 'http://localhost:8081/api/a?callback=999&name=zhangsan&age=18');
        xhr.onload = function(){
            const res = JSON.parse(xhr.responseText);
            console.log(res);
        }
        xhr.send();

    </script> -->
    <script>
        function test(res){
            console.log('结果是',res);
        }
    </script>
    <script src="http://localhost:8081/api/a?name=zhangsan&age=18&callback=test"></script>
    

</body>
</html>